import request from '@/utils/request'

// 查询列表
export function listDepartment(query) {
  return request({
    url: '/organization/department/list',
    method: 'get',
    params: query
  })
}

// 查询列表
export function findOrg(query) {
  return request({
    url: '/organization/department/findOrg',
    method: 'get',
    params: query
  })
}


// 查询列表
export function findAll(query) {
  return request({
    url: '/organization/department/findAll',
    method: 'get',
    params: {orgguid:query}
  })
}

// 查询详细
export function getDepartment(guid) {
  return request({
    url: '/organization/department/' + guid,
    method: 'get'
  })
}

// 新增
export function addDepartment(data) {
  return request({
    url: '/organization/department',
    method: 'post',
    data: data
  })
}

// 修改
export function updateDepartment(data) {
  return request({
    url: '/organization/department',
    method: 'put',
    data: data
  })
}

// 启用
export function disableDepartment(guid) {
  return request({
    url: '/organization/department/on',
    method: 'get',
    params: {guid:guid}
  })
}

// 删除
export function delDepartment(guid) {
  return request({
    url: '/organization/department/' + guid,
    method: 'delete'
  })
}

// 导出
export function exportDepartment(query) {
  return request({
    url: '/organization/department/export',
    method: 'get',
    params: query
  })
}

// 通过权限获取部门
export function getPermisForDepart(query) {
  return request({
    url: '/organization/department/getPermisForDepart',
    method: 'get',
    params: query
  })
}
